home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / idl / nsISVGRendererGlyphMetrics.idl < prev    next >
Text File  |  2006-05-08  |  5KB  |  127 lines

  1. /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /* ***** BEGIN LICENSE BLOCK *****
  3.  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  4.  *
  5.  * The contents of this file are subject to the Mozilla Public License Version
  6.  * 1.1 (the "License"); you may not use this file except in compliance with
  7.  * the License. You may obtain a copy of the License at
  8.  * http://www.mozilla.org/MPL/
  9.  *
  10.  * Software distributed under the License is distributed on an "AS IS" basis,
  11.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  12.  * for the specific language governing rights and limitations under the
  13.  * License.
  14.  *
  15.  * The Original Code is the Mozilla SVG project.
  16.  *
  17.  * The Initial Developer of the Original Code is
  18.  * Crocodile Clips Ltd.
  19.  * Portions created by the Initial Developer are Copyright (C) 2002
  20.  * the Initial Developer. All Rights Reserved.
  21.  *
  22.  * Contributor(s):
  23.  *   Alex Fritze <alex@croczilla.com> (original author)
  24.  *
  25.  * Alternatively, the contents of this file may be used under the terms of
  26.  * either of the GNU General Public License Version 2 or later (the "GPL"),
  27.  * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  28.  * in which case the provisions of the GPL or the LGPL are applicable instead
  29.  * of those above. If you wish to allow use of your version of this file only
  30.  * under the terms of either the GPL or the LGPL, and not to allow others to
  31.  * use your version of this file under the terms of the MPL, indicate your
  32.  * decision by deleting the provisions above and replace them with the notice
  33.  * and other provisions required by the GPL or the LGPL. If you do not delete
  34.  * the provisions above, a recipient may use your version of this file under
  35.  * the terms of any one of the MPL, the GPL or the LGPL.
  36.  *
  37.  * ***** END LICENSE BLOCK ***** */
  38.  
  39. #include "nsISupports.idl"
  40.  
  41. interface nsIDOMSVGRect;
  42.  
  43. /**
  44.  * \addtogroup renderer_interfaces Rendering Engine Interfaces
  45.  * @{
  46.  */
  47.  
  48. /**
  49.  * One of a number of interfaces (all starting with nsISVGRenderer*)
  50.  * to be implemented by an SVG rendering engine. See nsISVGRenderer
  51.  * for more details.
  52.  *
  53.  * The SVG rendering backend uses this interface to communicate to the
  54.  * rendering engine-native glyph metrics objects.
  55.  *
  56.  * A glyph metrics object is instantiated by the backend for a given
  57.  * nsISVGGlyphMetricsSource object with a call to
  58.  * nsISVGRenderer::createGlyphMetrics(). The glyph metrics object is
  59.  * assumed to store a reference to its associated source object and
  60.  * provide metrics information about the (composite) glyph described
  61.  * by nsISVGGlyphMetricsSource::characterData,
  62.  * nsISVGGlyphMetricsSource::font, nsISVGGlyphMetricsSource::canvasTM, and
  63.  * other relevant style such as nsISVGGlyphMetricsSource::strokeWidth.
  64.  */
  65. [scriptable, uuid(8665f6e9-6ed6-4ff8-b511-46c8068b3960)]
  66. interface nsISVGRendererGlyphMetrics : nsISupports
  67. {
  68.   /**
  69.    * Untransformed width of the composite glyph in pixels.
  70.    */
  71.   readonly attribute float advance;
  72.  
  73.   /**
  74.    * Untransformed bounding box of the composite glyph in pixel
  75.    * coordinates.
  76.    */
  77.   readonly attribute nsIDOMSVGRect boundingBox;
  78.  
  79.   /**
  80.    * Get the untransformed bounding box of an individual glyph.
  81.    *
  82.    * @param charnum The index of the character in
  83.    * nsISVGGlyphMetricsSource::characterData whose glyph bounding box
  84.    * is to be determined
  85.    * @return The untransformed bounding box in pixel coordinates
  86.    */
  87.   nsIDOMSVGRect getExtentOfChar(in unsigned long charnum);
  88.  
  89.   /**
  90.    * @name Baseline offset constants for getBaselineOffset()
  91.    * @{
  92.    */
  93.   const unsigned short BASELINE_ALPHABETIC       = 0;
  94.   const unsigned short BASELINE_HANGING          = 1;
  95.   const unsigned short BASELINE_IDEOGRAPHC       = 2;
  96.   const unsigned short BASELINE_MATHEMATICAL     = 3;
  97.   const unsigned short BASELINE_CENTRAL          = 4;
  98.   const unsigned short BASELINE_MIDDLE           = 5;
  99.   const unsigned short BASELINE_TEXT_BEFORE_EDGE = 6;
  100.   const unsigned short BASELINE_TEXT_AFTER_EDGE  = 7;
  101.   /** @} */
  102.   
  103.   /**
  104.    * Retrieve the (y-axis) offset of the given baseline.
  105.    * 
  106.    * @param baselineIdentifier One of the BASELINE_* constants defined
  107.    * in this interface.
  108.    * @return Y-axis offset in pixels relative to top of bounding box.
  109.    */
  110.   float getBaselineOffset(in unsigned short baselineIdentifier);
  111.  
  112.   /**
  113.    * Called by this object's corresponding nsISVGGlyphMetricsSource as
  114.    * a notification that some of the source's data (identified by
  115.    * paramter 'updatemask') has changed.
  116.    *
  117.    * @param updatemask An OR-ed combination of the UPDATEMASK_*
  118.    * constants defined in nsISVGGlyphMetricsSource.
  119.    * @return PR_TRUE if the metrics have changed as a result of the
  120.    * source update, PR_FALSE otherwise.
  121.    */
  122.   boolean update(in unsigned long updatemask); 
  123.  
  124. };
  125.  
  126. /** @} */
  127.